﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using nwrole.lib;
using nwrole.toolbox.sync.contract;
using nwrole.toolbox.sync.entity;

namespace nwrole.toolbox.sync.contract
{
    [ServiceContract]
    public interface ISyncDestinationService// ISyncSyncService
    {
        [OperationContract]
        SyncMessageEnvelope SyncComplete(SyncCompleteEnvelope command);

        [OperationContract]
        SyncMessageEnvelope ProcessMessage(SyncCommandEnvelope command);

        [OperationContract]
        void ProcessMessageOld(SyncMessageEnvelope message);

        [OperationContract]
        IntMessage GetMessage(long messageId);

        [OperationContract]
        List<IntMessage> GetFailedMessages();

        [OperationContract]
        List<IntMessageRow> GetFailedMessageRows(long messageId);

        [OperationContract]
        Result DeleteOldRowsFromDestinationTable(SyncEntity syncEntity);

        [OperationContract]
        bool DeployDestination(SyncEntity syncEntity);

        [OperationContract]
        bool DeployDestEnvironment();

        [OperationContract]
        void InitFileTransfer(Guid fileId, long totalBytes, string destPath);

        [OperationContract]
        void SendFilePart(Guid fileId, long offset, long bytes, byte[] data);
    }

    public interface ISyncDestinationServiceChannel : ISyncDestinationService, IClientChannel { }
}
